This post is all about the solution of the "B - Pass on Path" AtCoder Regular Contest 152 Problem Solution.
Problem Statement :
N is the length of a narrow straight road running east to west. This road will be visited by two travellers. There are N rest stops along the route. The spacing from the road's western end to the i-th camping ground is an i. (no rest area is at either end of the road). Except at rest stops, the road is so narrow that two travellers cannot pass each other or walk side by side.
The two travellers will travel along the following route.
At time zero, each traveller begins at a rest area of their choosing (the two may start at the same rest area). Then, each travels to both ends of the road before returning to their starting place.
Format of Input :
The input is given from Standard Input in the following format:
Format of the Output :
Print Yes; or else, print NoIf it is certain that all N groups will be able to sit.
0 Comments